package AggregationMethod;

import Global.ConstantVariable;
import Sampling.SamplingAbstractClass;

public class AggregationMethodFactory {

	public AggregationMethodInterface createAggregationMethod (String name, SamplingAbstractClass currentSampling)
	{
		try
		{
			if(name==ConstantVariable.AggregationMethod_ConstantVariables.BINARY_EXISTANCE_METHOD)
				return new BinaryExistanceMethodClass(currentSampling);
			if(name==ConstantVariable.AggregationMethod_ConstantVariables.MODE_METHOD)
				return new ModeMethodClass(currentSampling);
			if(name==ConstantVariable.AggregationMethod_ConstantVariables.MULTIHOP_METHOD)
				return new MultihopMethodClass(currentSampling);
			if(name==ConstantVariable.AggregationMethod_ConstantVariables.PROPORTION_METHOD)
				return new ProportionMethodClass(currentSampling);
			if(name==ConstantVariable.AggregationMethod_ConstantVariables.WEIGHTED_AVERAGE_METHOD)
				return new WeighthedAverageMethodClass(currentSampling);
			if(name==ConstantVariable.AggregationMethod_ConstantVariables.SUM)
				return new SumMethodClass(currentSampling);
			
			else 
				return  new SumMethodClass(currentSampling);
		}
		catch(Exception e)
		{
			System.out.println("Aggregation Method is not define in this system");
		}
		return null;
	}
	
}
